home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Disks.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  3.4 KB  |  134 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Disks.p
  3.  
  4.      Contains:    Disk Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1985-1991,1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Disks;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __DISKS__}
  28. {$SETC __DISKS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC DisksIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __OSUTILS__}
  38. {$I OSUtils.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46.  
  47. CONST
  48.     sony                        = 0;
  49.     hard20                        = 1;
  50.  
  51. { Disk Driver Status csCodes }
  52.     kReturnFormatList            = 6;                            {  .Sony  }
  53.     kDriveStatus                = 8;
  54.     kMFMStatus                    = 10;
  55.  
  56. { Disk Driver Control csCodes }
  57.     kVerify                        = 5;
  58.     kFormat                        = 6;
  59.     kEject                        = 7;
  60.     kSetTagBuffer                = 8;                            {  .Sony  }
  61.     kTrackCache                    = 9;                            {  .Sony  }
  62.     kDriveIcon                    = 21;
  63.     kMediaIcon                    = 22;
  64.     kDriveInfo                    = 23;
  65.     kRawTrack                    = 18244;                        {  .Sony: “diagnostic” raw track dump  }
  66.  
  67. {
  68.     Note:
  69.  
  70.     qLink is usually the first field in queues, but back in the MacPlus
  71.     days, the DrvSts record needed to be expanded.  In order to do this without
  72.     breaking disk drivers that already added stuff to the end, the fields
  73.     where added to the beginning.  This was originally done in assembly language
  74.     and the record was defined to start at a negative offset, so that the qLink
  75.     field would end up at offset zero.  When the C and pascal interfaces where
  76.     made, they could not support negative record offsets, so qLink was no longer
  77.     the first field.  Universal Interfaces are auto generated and don't support
  78.     negative offsets for any language, so DrvSts in Disks.a has qLinks at a
  79.     none zero offset.  Assembly code which switches to Universal Interfaces will
  80.     need to compensate for that.
  81.  
  82. }
  83.  
  84.  
  85. TYPE
  86.     DrvStsPtr = ^DrvSts;
  87.     DrvSts = RECORD
  88.         track:                    INTEGER;                                {  current track  }
  89.         writeProt:                SignedByte;                                {  bit 7 = 1 if volume is locked  }
  90.         diskInPlace:            SignedByte;                                {  disk in drive  }
  91.         installed:                SignedByte;                                {  drive installed  }
  92.         sides:                    SignedByte;                                {  -1 for 2-sided, 0 for 1-sided  }
  93.         qLink:                    QElemPtr;                                {  next queue entry  }
  94.         qType:                    INTEGER;                                {  1 for HD20  }
  95.         dQDrive:                INTEGER;                                {  drive number  }
  96.         dQRefNum:                INTEGER;                                {  driver reference number  }
  97.         dQFSID:                    INTEGER;                                {  file system ID  }
  98.         CASE INTEGER OF
  99.         0: (
  100.             twoSideFmt:            SignedByte;                                {  after 1st rd/wrt: 0=1 side, -1=2 side  }
  101.             needsFlush:            SignedByte;                                {  -1 for MacPlus drive  }
  102.             diskErrs:            INTEGER;                                {  soft error count  }
  103.            );
  104.         1: (
  105.             driveSize:            INTEGER;
  106.             driveS1:            INTEGER;
  107.             driveType:            INTEGER;
  108.             driveManf:            INTEGER;
  109.             driveChar:            INTEGER;
  110.             driveMisc:            SignedByte;
  111.            );
  112.     END;
  113.  
  114.     DrvSts2                                = DrvSts;
  115.     DrvSts2Ptr                             = ^DrvSts2;
  116.  
  117. CONST
  118.     kdqManualEjectBit            = 5;
  119.  
  120. FUNCTION DiskEject(drvNum: INTEGER): OSErr;
  121. FUNCTION SetTagBuffer(buffPtr: UNIV Ptr): OSErr;
  122. FUNCTION DriveStatus(drvNum: INTEGER; VAR status: DrvSts): OSErr;
  123.  
  124. {$ALIGN RESET}
  125. {$POP}
  126.  
  127. {$SETC UsingIncludes := DisksIncludes}
  128.  
  129. {$ENDC} {__DISKS__}
  130.  
  131. {$IFC NOT UsingIncludes}
  132.  END.
  133. {$ENDC}
  134.